# -*- coding: utf-8 -*-

pref_colors2 = ["#CF3C57", "#65B23A", "#6170DD", "#D18738", "#D542B5",
                "#724A63", "#60AABA", "#5DB07C", "#6C5824", "#D74B2B", "#6B97D6", "#893B2E",
                "#B68DB7", "#564E91", "#ACA13C", "#3C6171", "#436B33", "#D84088",
                "#D67A77", "#9D55C4", "#8B336E", "#DA77B9", "#D850E5", "#B188DF"]


pref_colors = ['#EE204D', '#FCE883', '#1F75FE', '#B4674D', '#FF7538', '#1CAC78',
               '#926EAE', '#232323', '#FFAACC', '#FFB653', '#199EBD', '#C0448F',
               '#FF5349', '#C5E384', '#7366BD', '#EDEDED', '#F75394', '#FDDB6D',
               '#1DACD6', '#FDD9B5', '#FC2847', '#F0E891', '#5D76CB', '#95918C']

Nogs = {'NOG': 'All organisms (5.0GB)',
        'aciNOG': 'Acidobacteria (125.3MB)',
        'acidNOG': 'Acidobacteriia (75.4MB)',
        'acoNOG': 'Aconoidasida (217.1MB)',
        'actNOG': 'Actinobacteria (765.3MB)',
        'agaNOG': 'Agaricales (211.1MB)',
        'agarNOG': 'Agaricomycetes (236.5MB)',
        'apiNOG': 'Apicomplexa (322.7MB)',
        'aproNOG': 'Proteobacteria_alpha (638.4MB)',
        'aquNOG': 'Aquificae (51.5MB)',
        'arNOG': 'Archaea (256.9MB)',
        'arcNOG': 'Archaeoglobi (21.8MB)',
        'artNOG': 'Arthropoda (725.0MB)',
        'arthNOG': 'Arthrodermataceae (111.2MB)',
        'ascNOG': 'Ascomycota (1.1GB)',
        'aveNOG': 'Aves (186.1MB)',
        'bacNOG': 'Bacilli (362.6MB)',
        'bactNOG': 'Bacteria (3.3GB)',
        'bacteNOG': 'Bacteroidia (199.2MB)',
        'basNOG': 'Basidiomycota (356.5MB)',
        'bctoNOG': 'Bacteroidetes (508.9MB)',
        'biNOG': 'Bilateria (1.7GB)',
        'bproNOG': 'Proteobacteria_beta (481.0MB)',
        'braNOG': 'Brassicales (275.4MB)',
        'carNOG': 'Carnivora (293.5MB)',
        'chaNOG': 'Chaetomiaceae (180.9MB)',
        'chlNOG': 'Chlorobi (51.3MB)',
        'chlaNOG': 'Chlamydiae (39.1MB)',
        'chloNOG': 'Chloroflexi (136.8MB)',
        'chlorNOG': 'Chloroflexi (75.8MB)',
        'chloroNOG': 'Chlorophyta (146.8MB)',
        'chorNOG': 'Chordata (1.1GB)',
        'chrNOG': 'Chromadorea (392.6MB)',
        'cloNOG': 'Clostridia (505.6MB)',
        'cocNOG': 'Coccidia (137.4MB)',
        'creNOG': 'Crenarchaeota (110.0MB)',
        'cryNOG': 'Cryptosporidiidae (105.4MB)',
        'cyaNOG': 'Cyanobacteria (254.8MB)',
        'cytNOG': 'Cytophagia (164.6MB)',
        'debNOG': 'Debaryomycetaceae (145.5MB)',
        'defNOG': 'Deferribacteres (41.6MB)',
        'dehNOG': 'Dehalococcoidetes (15.0MB)',
        'deiNOG': 'Deinococcusthermus (75.4MB)',
        'delNOG': 'delta/epsilon (471.4MB)',
        'dipNOG': 'Diptera (397.7MB)',
        'dotNOG': 'Dothideomycetes (298.2MB)',
        'dproNOG': 'Proteobacteria_delta (424.6MB)',
        'droNOG': 'Drosophilidae (314.1MB)',
        'eproNOG': 'Proteobacteria_epsilon (104.8MB)',
        'eryNOG': 'Erysipelotrichi (85.8MB)',
        'euNOG': 'Eukaryotes (3.1GB)',
        'eurNOG': 'Euryarchaeota (264.7MB)',
        'euroNOG': 'Eurotiomycetes (507.2MB)',
        'eurotNOG': 'Eurotiales (358.1MB)',
        'fiNOG': 'Fishes (641.2MB)',
        'firmNOG': 'Firmicutes (728.8MB)',
        'flaNOG': 'Flavobacteriia (222.5MB)',
        'fuNOG': 'Fungi (1.2GB)',
        'fusoNOG': 'Fusobacteria (74.9MB)',
        'gproNOG': 'Proteobacteria_gamma (735.0MB)',
        'haeNOG': 'Haemosporida (197.1MB)',
        'halNOG': 'Halobacteria (106.6MB)',
        'homNOG': 'Hominidae (229.9MB)',
        'hymNOG': 'Hymenoptera (199.5MB)',
        'hypNOG': 'Hypocreales (353.3MB)',
        'inNOG': 'Insects (688.9MB)',
        'kinNOG': 'Kinetoplastida (259.8MB)',
        'lepNOG': 'Lepidoptera (208.0MB)',
        'lilNOG': 'Liliopsida (660.0MB)',
        'maNOG': 'Mammals (855.5MB)',
        'magNOG': 'Magnaporthales (161.3MB)',
        'meNOG': 'Animals (1.8GB)',
        'metNOG': 'Methanobacteria (38.4MB)',
        'methNOG': 'Methanococci (24.5MB)',
        'methaNOG': 'Methanomicrobia (99.4MB)',
        'necNOG': 'Nectriaceae (200.3MB)',
        'negNOG': 'Negativicutes (96.5MB)',
        'nemNOG': 'Nematodes (430.0MB)',
        'onyNOG': 'Onygenales (282.8MB)',
        'opiNOG': 'Opisthokonts (2.8GB)',
        'perNOG': 'Peronosporales (154.1MB)',
        'plaNOG': 'Planctomycetes (149.3MB)',
        'pleNOG': 'Pleosporales (223.4MB)',
        'poaNOG': 'Poales (596.3MB)',
        'prNOG': 'Primates (448.8MB)',
        'proNOG': 'Proteobacteria (1.5GB)',
        'rhaNOG': 'Rhabditida (334.5MB)',
        'roNOG': 'Rodents (381.4MB)',
        'sacNOG': 'Saccharomycetaceae (202.7MB)',
        'saccNOG': 'Saccharomycetes (275.9MB)',
        'sorNOG': 'Sordariales (296.1MB)',
        'sordNOG': 'Sordariomycetes (714.1MB)',
        'sphNOG': 'Sphingobacteriia (154.0MB)',
        'spiNOG': 'Spirochaetes (121.2MB)',
        'spriNOG': 'Supraprimates (635.6MB)',
        'strNOG': 'Streptophyta (960.6MB)',
        'synNOG': 'Synergistetes (59.5MB)',
        'tenNOG': 'Tenericutes (29.9MB)',
        'thaNOG': 'Thaumarchaeota (15.3MB)',
        'theNOG': 'Thermoplasmata (26.9MB)',
        'therNOG': 'Thermotogae (66.5MB)',
        'thermNOG': 'Thermococci (31.4MB)',
        'treNOG': 'Tremellales (79.9MB)',
        'veNOG': 'Vertebrates (1.0GB)',
        'verNOG': 'Verrucomicrobia (140.9MB)',
        'verrNOG': 'Verrucomicrobiae (73.0MB)',
        'virNOG': 'Viridiplantae (1.0GB)'}

COGS = {'J': '(J) Translation, ribosomal structure and biogenesis',
        'A': '(A) RNA processing and modification',
        'K': '(K) Transcription',
        'L': '(L) Replication, recombination and repair',
        'B': '(B) Chromatin structure and dynamics',
        'D': '(D) Cell cycle control, cell division, chromosome partitioning',
        'Y': '(Y) Nuclear structure',
        'V': '(V) Defense mechanisms',
        'T': '(T) Signal transduction mechanisms',
        'M': '(M) Cell wall/membrane/envelope biogenesis',
        'N': '(N) Cell motility',
        'Z': '(Z) Cytoskeleton',
        'W': '(W) Extracellular structures',
        'U': '(U) Intracellular trafficking, secretion, and vesicular transport',
        'O': '(O) Posttranslational modification, protein turnover, chaperones',
        'C': '(C) Energy production and conversion',
        'G': '(G) Carbohydrate transport and metabolism',
        'E': '(E) Amino acid transport and metabolism',
        'F': '(F) Nucleotide transport and metabolism',
        'H': '(H) Coenzyme transport and metabolism',
        'I': '(I) Lipid transport and metabolism',
        'P': '(P) Inorganic ion transport and metabolism',
        'Q': '(Q) Secondary metabolites biosynthesis, transport and catabolism',
        'R': '(R) General function prediction only',
        'S': '(S) Function unknown'}

DBURL = {'uniprot': 'ftp://ftp.ebi.ac.uk/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_sprot.fasta.gz',
         'uniprot-release': 'ftp://ftp.ebi.ac.uk/pub/databases/uniprot/current_release/knowledgebase/complete/reldate.txt',
         'merops': 'ftp://ftp.ebi.ac.uk/pub/databases/merops/current_release/merops_scan.lib',
         'dbCAN': 'http://bcb.unl.edu/dbCAN2/download/Databases/dbCAN-HMMdb-V7.txt',
         'dbCAN-tsv': 'http://bcb.unl.edu/dbCAN2/download/Databases/CAZyDB.07312018.fam-activities.txt',
         'dbCAN-log': 'http://bcb.unl.edu/dbCAN2/download/Databases/dbCAN-old@UGA/readme.txt',
         'pfam': 'ftp://ftp.ebi.ac.uk/pub/databases/Pfam//current_release/Pfam-A.hmm.gz',
         'pfam-tsv': 'ftp://ftp.ebi.ac.uk/pub/databases/Pfam//current_release/Pfam-A.clans.tsv.gz',
         'pfam-log': 'ftp://ftp.ebi.ac.uk/pub/databases/Pfam//current_release/Pfam.version.gz',
         'outgroups': 'https://osf.io/r9sne/download?version=1',
         'repeats': 'https://osf.io/vp87c/download?version=1',
         'go-obo': 'http://purl.obolibrary.org/obo/go.obo',
         'mibig': 'https://dl.secondarymetabolites.org/mibig/mibig_prot_seqs_1.4.fasta',
         'interpro': 'ftp://ftp.ebi.ac.uk/pub/databases/interpro/interpro.xml.gz',
         'gene2product': 'https://raw.githubusercontent.com/nextgenusfs/gene2product/master/ncbi_cleaned_gene_products.txt'}

buscoTree = 'eukaryota (303)\n\tmetazoa (978)\n\t\tnematoda (982)\n\t\tarthropoda (1066)\n\t\t\tinsecta (1658)\n\t\t\tendopterygota (2442)\n\t\t\thymenoptera (4415)\n\t\t\tdiptera (2799)\n\t\tvertebrata (2586)\n\t\t\tactinopterygii (4584)\n\t\t\ttetrapoda (3950)\n\t\t\taves (4915)\n\t\t\tmammalia (4104)\n\t\teuarchontoglires (6192)\n\t\t\tlaurasiatheria (6253)\n\tfungi (290)\n\t\tdikarya (1312)\n\t\t\tascomycota (1315)\n\t\t\t\tpezizomycotina (3156)\n\t\t\t\t\teurotiomycetes (4046)\n\t\t\t\t\tsordariomycetes (3725)\n\t\t\t\t\tsaccharomycetes (1759)\n\t\t\t\t\t\tsaccharomycetales (1711)\n\t\t\tbasidiomycota (1335)\n\t\tmicrosporidia (518)\n\tembryophyta (1440)\n\tprotists (215)\n\t\talveolata_stramenophiles (234)\n'

busco_links = {
    'fungi': ('https://osf.io/xvzmu/download?version=1', 'fungi_odb9'),
    'microsporidia': ('https://osf.io/r47nx/download?version=1', 'microsporidia_odb9'),
    'dikarya': ('https://osf.io/av6f8/download?version=1', 'dikarya_odb9'),
    'ascomycota': ('https://osf.io/z2736/download?version=1', 'ascomycota_odb9'),
    'pezizomycotina': ('https://osf.io/bj3sm/download?version=1', 'pezizomycotina_odb9'),
    'eurotiomycetes': ('https://osf.io/nvt3z/download?version=1', 'eurotiomycetes_odb9'),
    'sordariomycetes': ('https://osf.io/r24kn/download?version=1', 'sordariomyceta_odb9'),
    'saccharomycetes': ('https://osf.io/mpu2k/download?version=1', 'saccharomyceta_odb9'),
    'saccharomycetales': ('https://osf.io/dhk47/download?version=1', 'saccharomycetales_odb9'),
    'basidiomycota': ('https://osf.io/2xnsj/download?version=1', 'basidiomycota_odb9'),
    'eukaryota': ('https://osf.io/psj2k/download?version=1', 'eukaryota_odb9'),
    'protists': ('https://osf.io/a4tsk/download?version=1', 'protists_ensembl'),
    'alveolata_stramenophiles': ('https://osf.io/waqpe/download?version=1', 'alveolata_stramenophiles_ensembl'),
    'metazoa': ('https://osf.io/5bvam/download?version=1', 'metazoa_odb9'),
    'nematoda': ('https://osf.io/u87d3/download?version=1', 'nematoda_odb9'),
    'arthropoda': ('https://osf.io/w26ez/download?version=1', 'arthropoda_odb9'),
    'insecta': ('https://osf.io/8qsa5/download?version=1', 'insecta_odb9'),
    'endopterygota': ('https://osf.io/pxdqg/download?version=1', 'endopterygota_odb9'),
    'hymenoptera': ('https://osf.io/q4ce6/download?version=1', 'hymenoptera_odb9'),
    'diptera': ('https://osf.io/e2n49/download?version=1', 'diptera_odb9'),
    'vertebrata': ('https://osf.io/w6kf8/download?version=1', 'vertebrata_odb9'),
    'actinopterygii': ('https://osf.io/dj2cw/download?version=1', 'actinopterygii_odb9'),
    'tetrapoda': ('https://osf.io/bp4cf/download?version=1', 'tetrapoda_odb9'),
    'aves': ('https://osf.io/e7qym/download?version=1', 'aves_odb9'),
    'mammalia': ('https://osf.io/dvy5m/download?version=1', 'mammalia_odb9'),
    'euarchontoglires': ('https://osf.io/p3nc7/download?version=1', 'euarchontoglires_odb9'),
    'laurasiatheria': ('https://osf.io/2v9hj/download?version=1', 'laurasiatheria_odb9'),
    'embryophyta': ('https://osf.io/m67p4/download?version=1', 'embryophyta_odb9')}
